<template>
	<div class="ButtonGroup">
		<slot name="prepend"></slot>
		<ov-button
			v-for="item in config"
			:key="item"
			:class="item.class ? item.class : ''"
			:type="item.type ? item.type : 'primary'"
			:link="item.link ? item.link : false"
			:disabled="item.disabled ? item.disabled : false"
			:round="item.round ? item.round : false"
			:circle="item.circle ? item.circle : false"
			@click="handleClick(item.eventName)"
		>
			{{ item.text }}
		</ov-button>
		<slot name="append"></slot>
	</div>
</template>

<script setup>
const emit = defineEmits(["click"])
const props = defineProps({
	config: {
		type: Array,
		default: () => []
	}
})
const handleClick = eventName => {
	emit("click", eventName)
}
</script>

<style scoped lang="less"></style>
